        
        
       
        var whetherInView = chasingMouse = null;
        
        var smallWindow = window.innerWidth < 768?true:false;
        $(document).ready(function(){
            var news = []
            for(var n = 0;n < $('.news .swiper-slide').length;n++){
                $('.news .swiper-slide')[n].ind = n;
                news.push($('.news .swiper-slide')[n]);
            }
            whetherInView = setInterval(function(){
                if(smallWindow){
                    if(window.innerWidth >= 768 && $('.news')[0].className.indexOf('updated') < 0){
                        $('.news').addClass('updated');
                        newsSwiper.update();
                    }else if(window.innerWidth < 768 && $('.news')[0].className.indexOf('updated') >= 0){
                        $('.news').removeClass('updated');
                        newsSwiper.update();
                    }
                }else{
                    if(window.innerWidth < 768 && $('.news')[0].className.indexOf('updated') < 0){
                        $('.news').addClass('updated');
                        newsSwiper.update();
                    }else if(window.innerWidth >= 768 && $('.news')[0].className.indexOf('updated') >= 0){
                        $('.news').removeClass('updated');
                        newsSwiper.update();
                    }
                }
                var newsSwiper_w = $('.news')[0].offsetWidth;
                var newsSwiper_l = $('.news')[0].getBoundingClientRect().left;
                for(var i = 0;i < news.length;i++){
                    var left = news[i].getBoundingClientRect().left;
                    var ind = news[i].ind;
                    if(left <= (newsSwiper_w + newsSwiper_l)){
                        $('.news .swiper-slide:eq(' + ind + ')').addClass('inview');
                        news.splice(i,1);
                        return false;
                    }
                }
            },10)
            $('body').mousemove(function(event){
                //mousemove所操作的函数如果return false会导致长按拖动鼠标无法复制文字
                //if(window.innerWidth < 768) return false;
                mouseX = event.clientX || 0;
                mouseY = event.clientY || 0;
                if($('.cursorBox .followCursor')[0].className.indexOf('visible') >= 0){
                    var val = 'translate(' + mouseX + 'px,' + mouseY +'px)';
                    $('.cursorBox .followCursor').css('transform',val);
                }
            })
            chasingMouse = setInterval(function(){
                var ele_h = $('.cursorBox').height();
                var ele_w = $('.cursorBox').width();
                var targetLeft = mouseX - $('.cursorBox')[0].getBoundingClientRect().left;
                var targetTop = mouseY - $('.cursorBox')[0].getBoundingClientRect().top;
                if((targetLeft < 0 || targetLeft > ele_w) || (targetTop < 0 || targetTop > ele_h)){
                    if($('.cursorBox .followCursor')[0].className.indexOf('visible') < 0) return false;
                    $('.cursorBox .followCursor').removeClass('visible');
                }else{
                    if($('.cursorBox .followCursor')[0].className.indexOf('visible') >= 0) return false;
                    $('.cursorBox .followCursor').addClass('visible');
                }
            },10)

        }) 